<?php

namespace addons\helper\controller\wxapp;

use addons\helper\controller\wxapp\Base;
use app\admin\model\Admin;
use app\admin\model\SellerCode;
use fast\Tree;
use think\Session;

class StoreShop extends Base
{
    protected $searchFields = 'id';

    protected $noNeedRight = ['*'];
    protected $categorylist = [];

    public function _initialize()
    {
        parent::_initialize();
        $this->model = new \app\admin\model\StoreShop;
    }

    public function index()
    {
        //当前是否为关联查询
        $this->relationSearch = true;
        //设置过滤方法
        $this->request->filter(['strip_tags', 'trim']);
        list($where, $sort, $order, $offset, $limit) = $this->buildparams();

        if ($this->userId != get_addon_config('douyin')['super_id']) {

                $this->model->where($this->model->getTable() . '.admin_id', 'in',$this->userId);
        }

        $list = $this->model
            ->where($where)
            ->order($sort, $order)
            ->paginate($limit);


        $result = array("total" => $list->total(), "rows" => $list->items());
        $this->success('ok', $result);




    }




}
